#ifndef SLICINGSETTINGSDIALOG_H
#define SLICINGSETTINGSDIALOG_H

#include <QPushButton>
#include <QLineEdit>
#include <QSlider>
#include <QDialog>
#include <QRegularExpressionValidator>

#include <QVector3D>

namespace Ui {
class SlicingSettingsDialog;
}

class SlicingSettingsDialog : public QDialog
{
    Q_OBJECT

public:
    explicit SlicingSettingsDialog(QWidget *parent = nullptr);
    ~SlicingSettingsDialog();

public:
    void iniUI();
    QVector3D planeNormal() const;
    QVector3D cameraUp() const;
    float cameraDistance() const;
    float slicingStride() const;
    void setPlaneNormal(const QVector3D &normal);
    void setCameraUp(const QVector3D& cameraUp);
    void setCameraDistance(float distance);
    void setSlicingStride(float stride);

signals:
    void slicingSettingsConfirmed(const QVector3D& planeNormal, const QVector3D& cameraUp, float cameraDistance, float slicingStride);

private slots:
    void on_cameraDistanceSlider_sliderMoved(int position);
    void on_settingConfirmed_accepted();
    void on_settingConfirmed_rejected();

private:
    Ui::SlicingSettingsDialog *ui;
    QVector3D m_camera_up;
    QRegularExpressionValidator *normalVectorValidator, *positiveFloatValidator;
};

#endif // SLICINGSETTINGSDIALOG_H
